package sung;

import java.util.ArrayList;

import sung.extendmethod.ParentFindNumber;

public class ExtendFindNumbers extends ParentFindNumber {
	
	public void findNumberASC(){
		ArrayList<Integer> findNumber = findUserReqNO(33);
		int tempInteger = 0;
		//중간체크
		for (int i = 0; i < findNumber.size(); i++) {			
			System.out.println("리터받은 "+i+"="+findNumber.get(i));
		}
		
		for(int i=0;i<findNumber.size();i++){
			for (int j = i+1; j < findNumber.size(); j++) {
				if(findNumber.get(i) > findNumber.get(j)){
					tempInteger = findNumber.get(i);
					findNumber.set(i, findNumber.get(j));
					findNumber.set(j, tempInteger);
				}
			}
		}
		
		for(int i=0;i<findNumber.size();i++){
			System.out.print("결과 "+i+"="+findNumber.get(i));
		}
	}
	
	public void findLowestNumber(){
		ArrayList<Integer> findNumber = findUserReqNO(33);
		int lowestNumber = 0;
		//중간체크
		for (int i = 0; i < findNumber.size(); i++) {			
			System.out.println(i+"="+findNumber.get(i));
		}
		
		for(int i=0;i<findNumber.size();i++){
			for (int j = i+1; j < findNumber.size(); j++) {
				if(findNumber.get(i) > findNumber.get(j)){
					lowestNumber = findNumber.get(j);
				}
			}
		}
		
		System.out.println("lowestNumber="+lowestNumber);
	}
	
	public void findHighestNumber(){
		ArrayList<Integer> findNumber = findUserReqNO(33);
		int highestNumber = 0;
		//중간체크
		for (int i = 0; i < findNumber.size(); i++) {			
			System.out.println(i+"="+findNumber.get(i));
		}
		
		for(int i=0;i<findNumber.size();i++){
			for (int j = i+1; j < findNumber.size(); j++) {
				if(findNumber.get(i) > findNumber.get(j)){
					highestNumber = findNumber.get(i);
				}
			}
		}
		
		System.out.println("highestNumber="+highestNumber);
	}
	
	public static void main(String[] args) {
		ExtendFindNumbers number = new ExtendFindNumbers();
		//number.findHighestNumber();
		//number.findLowestNumber();
		number.findNumberASC();
	}
}
